package cn.com.bluemoon.daps.system.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

/**
 * @author Jarod.Kong
 */
@Data
@ApiModel("通知信息详情页")
public class NoticeResponseDetailVo implements Serializable {

    private BaseInfo baseInfo;

    private TemplateImpact template;

    private List<ConfirmInfo> relatedInfo;

    @Data
    public static class BaseInfo implements Serializable {

        @ApiModelProperty(value = "主键")
        private Long id;

        @ApiModelProperty(value = "通知的标题")
        private String noticeTitle;

        @ApiModelProperty(value = "收件人")
        private List<String> receiveUserIds;

        @ApiModelProperty(value = "抄送人")
        private List<String> ccUserIds;

        @ApiModelProperty(value = "通知的模板 1-影响通知")
        private Integer noticeTemplate;

        @ApiModelProperty(value = "通知方式 1-邮件")
        private Integer noticeMode;

        @ApiModelProperty(value = "通知状态 0-失败 1-成功")
        private Integer noticeStatus;

        @ApiModelProperty(value = "发送时间")
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
        private LocalDateTime sendTime;

        public BaseInfo() {
        }

    }

    @Data
    public static class TemplateImpact implements Serializable {

        @ApiModelProperty(value = "主键")
        private Long id;

        @ApiModelProperty(value = "变更人")
        private String changeUser;

        @ApiModelProperty(value = "变更类型 1-表变更 2-归档变更-表归档")
        private Integer changeType;

        @ApiModelProperty(value = "所属系统")
        private String systemId;

        @ApiModelProperty(value = "变更表名")
        private String changeTableName;

        @ApiModelProperty(value = "变更表的Schema")
        private String changeTableSchema;

        @ApiModelProperty(value = "归档表名")
        private String archiveTableName;

        @ApiModelProperty(value = "变更脚本")
        private String changeScript;

        @ApiModelProperty(value = "计划变更时间")
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
        private LocalDateTime planChangeTime;

        @ApiModelProperty(value = "变更原因")
        private String changeReason;

        @ApiModelProperty(value = "归档存储信息")
        private String archiveInfo;

        @ApiModelProperty(value = "影响分析的结果")
        private String impactAnalysisResult;

    }

    @Data
    public static class ConfirmInfo implements Serializable {

        @ApiModelProperty(value = "主键")
        private Long id;

        @ApiModelProperty(value = "操作用户")
        private String operateUserName;

        @ApiModelProperty(value = "工号")
        private String operateUserId;

        @ApiModelProperty(value = "岗位")
        private String operateUserZw;

        @ApiModelProperty(value = "确认状态 0-未确认 1-已经确认同意 2-无需确认 3-失效账号 4-已确认不同意")
        private Integer confirmStatus;

        @ApiModelProperty(value = "通知状态 0-失败 1-成功")
        private Integer sendStatus;

        @ApiModelProperty(value = "操作时间")
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
        private LocalDateTime operateTime;
    }

}
